<script src="vue.js"></script>

<body>
    <div id="app">
        <input type="text" v-model="cityName" />
    </div>
</body>
<script>
    var vue=new Vue({
        el: '#app',
        data: {
            cityName: "地球"
        },
        watch: {
            cityName(newName,oldName){
                console.log(newName,oldName);
            }
        }
    });
</script>